CC     = gcc
CFLAGS = -ggdb
LIBS   = -lm -lX11
OBJS   = linkmyco.o link.o polygon.o sweep.o distance.o geometry.o vordispl.o \
	voronoi.o vor_cntl.o heap.o

EXTRAOBJS = quad/fixedall.o

all:	main
	ar rcs libVoronoi.a $(OBJS) $(EXTRAOBJS)
.c.o:
	$(CC) $(CFLAGS) -I. -c $< 

main:	$(OBJS) $(EXTRAOBJS)

linkmyco.o:    linkmyco.c link.h ../common.h
link.o:        link.c link.h globals.h
heap.o:        heap.c heap.h globals.h
polygon.o:     polygon.c polygon.h globals.h geometry.h sgidrawi.h
sweep.o:       sweep.c sweep.h heap.h link.h polygon.h \
               globals.h geometry.h voronoi.h sgidrawi.h
vordispl.o:    vordispl.c voronoi.h globals.h geometry.h polygon.h
distance.o:    distance.c distance.h globals.h geometry.h polygon.h
sgidrawi.o:    sgidrawi.c sgidrawi.h
voronoi.o:     voronoi.c globals.h geometry.h polygon.h distance.h sweep.h
vor_cntl.o:    vor_cntl.c globals.h geometry.h polygon.h sweep.h
tang.o:        tang.c main.h
vorvtx.o:      vorvtx.c main.h voronoi.h
commands.o:    commands.c commands.h
quad/fixedall.o: 
	cd quad && $(MAKE)

clean: 
	-rm -f $(OBJS)
	
rclean: clean
	cd quad && $(MAKE) clean
